﻿@{
    ViewBag.IsDetails = false;
    Layout = "_Layout.cshtml";
    IQueryable<Post> posts = ViewBag.Posts;
    Term currentTerm = ViewBag.CurrentTerm;
    int pageIndex = ViewBag.PageIndex;
    ViewBag.Title = string.Format("{0} - 第{1}页 | {2} - Powered by Wedn.Net", currentTerm.Name, pageIndex, Setting.SiteName);
}
<!--正文开始-->
<div class="main">
    <div id="mapsite">当前位置： @(currentTerm.Type == (short)TermType.PostCategory ? "分类" : "标签") “@currentTerm.Name” 的内容</div>
    @foreach (var item in posts)
    {
        <ul class="post">
            <li>
                <h2>
                    <a href="@item.Link" title="详细阅读 @item.Title">@item.Title</a>
                    @if (DateTime.Now.Subtract(item.PubDate).Days < 2)
                    {<span class="new"><img src="@(Setting.CurrentThemePath)/images/new.gif" alt="较新的文章" title="较新的文章"></span>}
                </h2>
                <div class="post_date"><span class="date_m">@item.PubDate.ToString("MMM")</span><span class="date_d">@item.PubDate.ToString("dd")</span><span class="date_y">@item.PubDate.ToString("yyyy")</span></div>
                <div class="article">
                    <div class="thumbnail_box">
                        <div class="thumbnail">
                            <a href="@item.Link" title="@item.Title">
                                <img src="@(Setting.CurrentThemePath)/images/random/tb@(StringHelper.GetRandom(1, 20)).jpg" alt="@item.Title" title="@item.Title" style="opacity: 1; width: 140px; height: 100px">
                            </a>
                        </div>
                    </div>
                    <div class="entry_post">
                        <p>@item.Excerpt</p>
                        <div class="more"><a href="@item.Link" title="详细阅读 @item.Title" rel="bookmark">阅读全文</a></div>
                    </div>
                    <div class="clear"></div>
                    <div class="info">作者：@item.Author | 分类：@Html.Raw(!string.IsNullOrEmpty(item.Categorys) ? item.Categorys : "暂无") | 热度：@item.ViewCount ℃ | 标签：@Html.Raw(!string.IsNullOrEmpty(item.Tags) ? item.Tags : "暂无")</div>
                    <div class="comments_num"><a href="@item.Link#comments" title="《@item.Title》上的评论">@(item.CommentCount > 0 ? item.CommentCount + "条评论" : "抢沙发")</a></div>
                </div>
            </li>
        </ul>
        <div class="clear"></div>
    }
    <div class="navigation">
        <div class="pagination">
            @Html.RenderPager(10, pageIndex, (int)ViewBag.TotalCount)
        </div>
    </div>
</div>
<!--正文结束-->
@Html.Partial("_Sidebar")